import { Spin } from '@arco-design/web-react';
import React, { lazy, Suspense } from 'react';
import styled from 'styled-components';
import { Routes, Route, } from 'react-router-dom'

const Mainpage = lazy(()=>import('@/renderer/page/Mainpage/Mainpage'));

interface IRouterConfig {
    config?: Record<string, any>;
}

const StyledSpin = styled(Spin)`
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
`;

const RouterConfig = (_props: IRouterConfig) => {
    
    return (
        <Suspense fallback={
            <StyledSpin dot ></StyledSpin>
        }>
            <Routes>
                <Route path="/" element={<Mainpage />} />
            </Routes>
        </Suspense>
    )
}


export default RouterConfig;